<?php
include('class/class_connect.php');
include('class/class_page.php');
include('class/abstract/class_paginator.php');
include('class/class_news.php');
include('class/class_address.php');
include('class/class_rating.php');
include('class/tabs/class_tabs.php');
include('class/abstract/class_mainObjectInfo.php');
include('class/city_rus.php');
include('class/class_checkGetData.php');

session_start();
if(!isset($_SESSION['login']))header('location: registr.php');
class myFirms extends paginator
{
	function __construct()
	{
		parent::__construct(15);
	}
	function countRows()
	{
		$aConnect=new connect('main');
		return mysql_num_rows($aConnect->select_all('nets', "WHERE user='".$_SESSION['login']."'"));
	}
	function pageContent()
	{
		$aConnect=new connect('main');

		$res=$aConnect->select_all('nets', "WHERE user='".$_SESSION['login']."' LIMIT ".$this->lim.", ".$this->limit."");
		while($this->row=mysql_fetch_array($res))
		{
			echo ('
			<div class="myFirmsFirm">
					<div class="subdivFirmsName">
						<h4><a href="netscabinet.php?city='.$_GET['city'].'&id='.$this->row['id'].'">'.$this->row['name'].'</a></h4>
					</div>
					<a href="netscabinet.php?city='.$_GET['city'].'&id='.$this->row['id'].'">
							<img class="subdivPic"
							src="pictures/netspics/'.$this->row['id'].'.jpg" title="'.$this->row['name'].'"">
					</a>
			</div>
			');
		}
	}
}

class aFirmPage extends page
{
	var $row=array();
	var $cityRus;
	function __construct()
	{
		$this->cityRus=new city_rus_class();
		parent::__construct();
	}
	function title()
	{
		echo $_SESSION['login'].' - мои фирмы';
	}
	function maincontent()
	{
		echo ('
		<div class="route">
			<div class="routeEl">
				<a href="pcabinet.php">Личный кабинет</a>
			</div>
			<div class="routeEl">
				Мои сети
			</div>
		</div>
		<link rel="stylesheet" type="text/css" href="style/cabinet.css" />
		');
		$aConnect=new connect('main');
		$row=mysql_fetch_array($aConnect->select_all('users', "WHERE login='".$_SESSION['login']."'"));
	  	$obj_city=new city_rus_class();


		if(isset($_GET['page'])){       //#страницы по умолчанию ноль
		$page=$_GET['page']-1;} else {
		$page=0;}
       $myFirms=new myFirms();

	}
}


$aPage=new aFirmPage();

?>